/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.jeck.action.cu_evento.ver;

import com.jeck.action.cu_evento.ver.data.Mg_ShowEvent;
import com.jeck.tools.Event;
import com.jeck.tools.Menu;
import com.struts.ActionBase;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author bicho
 */
public class ShowEvent extends ActionBase{
    int iduser=0;
    int idevento=0;
    List menu;
    String title;
    String description;
    @Override
    public String execute(){        
        if(idevento==0){
            idevento = Integer.parseInt( getRequest().getSession().getAttribute("idevento").toString() );
        }else{
             getRequest().getSession().setAttribute("idevento", idevento);
        }
        
        if(iduser==0){
            try{
            iduser = Integer.parseInt( getRequest().getSession().getAttribute("iduser").toString() );
            }catch(Exception e){
                System.out.println(e.getMessage());
            }
        }else{
             getRequest().getSession().setAttribute("iduser", iduser);
        }

        Event ev = Mg_ShowEvent.getEventoData(idevento);
        setTitle(ev.getName());
        setDescription(ev.getDescription());
        setMenu(Mg_ShowEvent.getMenuByIdUser(iduser));

        getRequest().getSession().setAttribute("menu",getMenu());

        return SUCCESS;
    }

    public int getIdevento() {
        return idevento;
    }

    public void setIdevento(int idevento) {
        this.idevento = idevento;
    }

    public List<Menu> getMenu() {
        return menu;
    }

    public void setMenu(List<Menu> menu) {
        this.menu = menu;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    
    

}
